﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OgilvyOne.UKNow.IDAL;
using OgilvyOne.UKNow.DAL;
using OgilvyOne.UKNow.Globalization;

namespace OgilvyOne.UKNow.DALFactory
{
    public class EventsLogDALFactory
    {
        private static readonly IDALEventsLog ChineseDAL = new EventsLogDAL(LanguageType.cn);
        private static readonly IDALEventsLog EnglishDAL = new EventsLogDAL(LanguageType.en);

        public static IDALEventsLog Create(int langID)
        {
            if (((LanguageType)Enum.Parse(typeof(LanguageType), langID.ToString())) == LanguageType.cn)
                return ChineseDAL;
            else
                return EnglishDAL;
        }

        public static IDALEventsLog Create(LanguageType languageType)
        {
            if (languageType == LanguageType.cn)
                return ChineseDAL;
            else
                return EnglishDAL;
        }
    }
}
